package com.doit.day01;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class _01_比较器 {
    public static void main(String[] args) {
        ArrayList<Order> list = new ArrayList<>();
        list.add(new Order(1, 1, 1, "001", 1.0, 1));
        list.add(new Order(4, 4, 4, "004", 4.0, 4));
        list.add(new Order(5, 5, 5, "005", 5.0, 5));
        list.add(new Order(6, 6, 6, "006", 6.0, 6));
        list.add(new Order(2, 2, 2, "002", 2.0, 2));
        list.add(new Order(3, 3, 3, "003", 3.0, 3));

        for (Order order : list) {
            System.out.println(order);
        }


        System.out.println("==============分隔符===================");

        Collections.sort(list);

        for (Order order : list) {
            System.out.println(order);
        }


/*        ArrayList<Integer> list1 = new ArrayList<>();
        list1.add(1);
        list1.add(3);
        list1.add(2);
        list1.add(6);
        list1.add(5);
        list1.add(4);
        list1.add(9);

        Collections.sort(list1);*/





    }
}
